//当前这个模块：api进行统一管理
import requests from './request';
import mockRequests from './mockAjax';

//三级联动接口
// /api/product/getBaseCategoryList get请求 无参数
//发请求:axios发请求返回的结果是promise对象
export const reqgetCategoryList = () => requests.get(`/product/getBaseCategoryList`);

//获取banner (home首页轮播图接口)
export const reqGetBannerList = () => mockRequests.get('/banner');

//第一步获取floor数据
export const reqGetFloorList = () => mockRequests.get('/floor');

//获取搜索模块数据 请求方式post 参数：带参
export const reqGetSearchInfo = (params) =>requests({url:"/list",method:"post",data:params})

//获取验证码
export const reqGetCode = (phone)=>requests({url:`/user/passport/sendCode/${phone}`,method:"get"});

//注册
export const reqUserRegister = (data)=>requests({url:`/user/passport/register`,method:"post",data:data})

//登录
export const reqUserLogin = (data)=>requests({url:`/user/passport/login`,method:"post",data:data})

//token校验获取用户登录信息 /user/passport/auth/getUserInfo
export const reqUserInfo = () =>requests({url:`/user/passport/auth/getUserInfo`,method:'get'})